package com.gec.it.util;

import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Md5Util {
    public static String digest(String pwd) {
        try {
            MessageDigest md5 = MessageDigest.getInstance("md5");//md5的加密工具
            byte[] bytes = md5.digest(pwd.getBytes("utf-8"));//md5
            String s = new BigInteger(1, bytes).toString(16);
            return s;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
